/**
 * Created by Administrator on 2017/3/23 0023.
 */
var Page9BF={
    create:function () {
        var page={};

        page.ui=new PIXI.DisplayObjectContainer();

        var bg=new PIXI.Graphics();
        bg.beginFill(0x0,1);
        bg.drawRect(0,0,pixiStageW,pixiStageH);
        bg.endFill();
        page.ui.addChild(bg);

        // var _mask=new PIXI.Graphics();
        // _mask.beginFill(0x0,1);
        // _mask.drawCircle(1136/2,640/2,2000);
        // _mask.endFill();
        // _mask.x=1136/2;
        // _mask.y=640/2;
        // stage.addChild(_mask);
        // bg.mask=_mask;
        var i1=new PIXI.Sprite(resource['assets/images/p9_i1.png'].texture);
        i1.anchor.set(0.5);
        i1.x=562;
        i1.y=306;
        page.ui.addChild(i1);

        var i0=new PIXI.Sprite(resource['assets/images/p9_i0.png'].texture);
        i0.anchor.set(0.5);
        i0.x=568;
        i0.y=251;
        page.ui.addChild(i0);



        var t0=new PIXI.Sprite(resource['assets/images/p9_t0.png'].texture);
        t0.anchor.set(0.5);
        t0.x=563;
        t0.y=560;
        page.ui.addChild(t0);

        var t1=new PIXI.Sprite(resource['assets/images/p9_t1.png'].texture);
        t1.anchor.set(0.5);
        t1.x=563;
        t1.y=560;
        page.ui.addChild(t1);
        
        page.In=function () {
            console.log('In')
            // bg.alpha=1;
            // _mask.scale.x=_mask.scale.y=0;
            // TweenMax.to(_mask.scale,1.5,{x:1,y:1,ease:Cubic.easeInOut});

            bg.alpha=0;
            TweenMax.to(bg,0.7,{delay:0,alpha:1,ease:Cubic.easeInOut});

            i0.scale.x=0
            i0.scale.y=1;
            TweenMax.to(i0.scale,0.6,{delay:1,x:1,y:1,ease:Cubic.easeInOut});

            //
            i1.alpha=0;
            i1.y=306+50;
            TweenMax.to(i1,0.7,{delay:1.5,y:306,alpha:1});

            t0.alpha=0;
            TweenMax.to(t0,1.2,{delay:2,alpha:1,ease:Cubic.easeInOut});
            TweenMax.to(t0,1.2,{delay:5,alpha:0,ease:Cubic.easeInOut});
            t1.alpha=0;
            TweenMax.to(t1,1.2,{delay:7,alpha:1,ease:Cubic.easeInOut});
            TweenMax.to(t1,1.2,{delay:10,alpha:0,ease:Cubic.easeInOut});


            
            setTimeout(function () {
                var event = new CustomEvent("Game_PageIn",{'detail':11});
                document.dispatchEvent(event);
            },12000);
        }

        return page;
    }
}